#include <iostream>

using namespace std;

int ack(int m, int n);

#include <iostream>
using namespace std;

int ack(int m,int n);


int main ( )
{
    int m,n,z;
    cout<<"enter the m and n"<<endl;
    cin >>n>>m;
    z=ack(m,n);
    cout<<z<<endl;

    cin>>z;
    return 0;
}

int ack(int m,int n)
{  
 

   if(m==0) 
       {
           return n+1;
        }
   else 
        {
            if(n==0) 
             {
                return ack(m-1,1);
             }
             else
             {
                    m=m-1;
                    n=ack(m,n-1);
                    
                    return ack(m,n);
              }
          }
}





